package cn.darksoul3.spark.operator

import org.apache.spark.{SparkConf, SparkContext}

object Foreach {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
    conf.setAppName("group by key").setMaster("local[*]")

    val sc = new SparkContext(conf)

    val rdd1 = sc.parallelize(List(1, 2, 3, 4, 5, 6, 7), numSlices = 2)
    rdd1.foreach(ele => println(ele * 1))

    sc.stop()

  }
}
